package com.xayy.health.mgt.model.vo;

import com.xayy.health.core.constant.HealthManagerConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.sql.Timestamp;

/**
 * @author lemon
 */
@Data
public class QualityVo {
    private Long id;
    /**
     * 卫星代号
     */
    @ApiModelProperty(value = "卫星代号")
    private String satelliteCode;
    @ApiModelProperty("领域标识")
    private String fieldId;
    @ApiModelProperty("数据时间")
    private Timestamp dataTimeStr;
    private String dataTime;

    public void setDataTime(Timestamp dataTimeStr) {
        String dataTimeStrLength = dataTimeStr.toString();
        if (dataTimeStrLength.length() == HealthManagerConstant.TIME_TWENTY_TWO) {
            dataTimeStrLength += "0";
        } else if (dataTimeStrLength.length() == HealthManagerConstant.TIME_TWENTY_ONE) {
            dataTimeStrLength += "00";
        }
        this.dataTime = dataTimeStrLength;
    }

    @ApiModelProperty("卫星标识(异常**识别字)")
    private String satelliteId;
    @ApiModelProperty("卫星名称")
    private String satelliteNm;
    @ApiModelProperty("异常类型码(1 识别字错误 2复帧)")
    private String anomalCd;
    @ApiModelProperty("异常描述")
    private String anomalDesc;
    @ApiModelProperty("异常积日(发生积日（天） 基准：2000 - 01 - 01:00:00:00)")
    private Integer wjd;
    @ApiModelProperty("异常积秒(发生当天积秒（0.1毫秒）)")
    private Integer dwjs;
    @ApiModelProperty("遥测主站标识")
    private Integer dwtmsta;
    @ApiModelProperty("来源系统(Zhongji 通信优化改**管控 通信一体化 **管控)")
    private String srcSys;
    @ApiModelProperty("ETL作业名")
    private String etlJabNm;
    @ApiModelProperty("ETL更新日期")
    private Timestamp etlUpdDtStr;
    private String etlUpdDt;

    public void setEtlUpdDt(Timestamp etlUpdDtStr) {
        String etlUpdDtStrLength = etlUpdDtStr.toString();
        if (etlUpdDtStrLength.length() == HealthManagerConstant.TIME_TWENTY_TWO) {
            etlUpdDtStrLength += "0";
        } else if (etlUpdDtStrLength.length() == HealthManagerConstant.TIME_TWENTY_ONE) {
            etlUpdDtStrLength += "00";
        }
        this.etlUpdDt = etlUpdDtStrLength;
    }

    @ApiModelProperty("异常前帧计数(丢帧（中断）前最后一帧帧计数)")
    private String befrFramId;
    @ApiModelProperty("异常后帧计数(丢帧（中断）恢复最新一帧帧计数)")
    private String aftrFramId;
    @ApiModelProperty("异常帧计数差值(丢帧（中断）帧计数差值)")
    private Integer anomalFramDiff;
    @ApiModelProperty("异常前时间(丢帧（中断）前最后一帧时间)")
    private Timestamp befrTimeStr;
    private String befrTime;

    public void setBefrTime(Timestamp befrTimeStr) {
        String befrTimeStrLength = befrTimeStr.toString();
        if (befrTimeStrLength.length() == HealthManagerConstant.TIME_TWENTY_TWO) {
            befrTimeStrLength += "0";
        } else if (befrTimeStrLength.length() == HealthManagerConstant.TIME_TWENTY_ONE) {
            befrTimeStrLength += "00";
        }
        this.befrTime = befrTimeStrLength;
    }

    @ApiModelProperty("异常后时间(丢帧（中断）恢复最新一帧时间)")
    private Timestamp aftrTimeStr;
    private String aftrTime;

    public void setAftrTime(Timestamp aftrTimeStr) {
        String aftrTimeStrLength = aftrTimeStr.toString();
        if (aftrTimeStrLength.length() == HealthManagerConstant.TIME_TWENTY_TWO) {
            aftrTimeStrLength += "0";
        } else if (aftrTimeStrLength.length() == HealthManagerConstant.TIME_TWENTY_ONE) {
            aftrTimeStrLength += "00";
        }
        this.aftrTime = aftrTimeStrLength;
    }

    @ApiModelProperty("异常时长（毫秒）(异常后时间-异常前时间)")
    private Integer anomalTimes;
    @ApiModelProperty("异常前**主站标识")
    private Integer befrDwtmsta;
    @ApiModelProperty("异常后**主站标识")
    private Integer aftrDwtmsta;
}
